<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% trigger = grab_attributes(pwd)['trigger'] -%>
describe google_cloudbuild_triggers(project: <%= gcp_project_id -%>) do
  its('count') { should eq 1 }
end

google_cloudbuild_triggers(project: <%= gcp_project_id -%>).ids.each do |id|
  describe google_cloudbuild_trigger(project: <%= gcp_project_id -%>, id: id) do
    its('filename') { should eq <%= doc_generation ? "'#{trigger['filename']}'" : "trigger['filename']" -%> }
    its('trigger_template.branch_name') { should eq <%= doc_generation ? "'#{trigger['trigger_template_branch']}'" : "trigger['trigger_template_branch']" -%> }
    its('trigger_template.repo_name') { should eq <%= doc_generation ? "'#{trigger['trigger_template_repo']}'" : "trigger['trigger_template_repo']" -%> }
    its('trigger_template.project_id') { should eq <%= doc_generation ? "'#{trigger['trigger_template_project']}'" : "trigger['trigger_template_project']" -%> }
  end
end